<%@ page import="com.Monica.pojo.Person" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: 86182
  Date: 2020/10/28
  Time: 17:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
        <%
            Person person = new Person();
            person.setName("我好帅！");
            person.setPhones(new String[]{"11","22","33"});
            List<String> cities = new ArrayList<String>();
            cities.add("北京");
            cities.add("上海");
            cities.add("深圳");
            person.setCities(cities);
            Map<String,Object> map = new HashMap<>();
            map.put("key1","value1");
            map.put("key2","value2");
            map.put("key3","value3");
            person.setMap(map);

            pageContext.setAttribute("person",person);
        %>
        输出Person：${person}<br>
        输出Person的name属性：${person.name}<br>
        输出Person的pnons数组属性值：${person.phones[0]}<br>
        输出Person的cities集合中的元素值：${person.cities}<br>
        输出Person的List集合中个别元素值：${person.cities[1]}<br>
        输出Person的Map集合：${person.map}<br>
        输出Person的Map集合中某个key的值：${person.map.key1}<br>
        输出Person的age属性：${person.age}//调用的是Person类中的 getAge()方法
</body>
</html>
